package com.xinchao.job;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 
 * <p>Title: TaskRunner</p>  
 * <p>Description: 应用启动时，初始化任务调度</p>  
 * @author huangf 
 * @date 2018年5月15日
 */
@Component
public class TaskStartRunner implements ApplicationRunner{
    
	private final static Logger logger = LoggerFactory.getLogger(TaskStartRunner.class);
	
	@Autowired
    private JobManager jobManager; 
	
	@Override
    public void run(ApplicationArguments var) throws Exception{
		logger.info("############应用启动，开始执行job任务！#############");
		jobManager.run();
    }

}